home *** CD-ROM | disk | FTP | other *** search
- unit Cciccinf;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Grids, Outline, CCWSock;
-
- type
- TCCICInfoDlg = class(TForm)
- Panel1: TPanel;
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- Panel4: TPanel;
- ListBox2: TListBox;
- Panel2: TPanel;
- Edit1: TEdit;
- Panel3: TPanel;
- Edit2: TEdit;
- Panel5: TPanel;
- Edit3: TEdit;
- Panel8: TPanel;
- Edit4: TEdit;
- Panel9: TPanel;
- Edit5: TEdit;
- Panel6: TPanel;
- Label1: TLabel;
- Label2: TLabel;
- Button1: TButton;
- Button2: TButton;
- Button3: TButton;
- Button4: TButton;
- ListBox1: TListBox;
- procedure Button1Click(Sender: TObject);
- procedure ListBox2Click(Sender: TObject);
- procedure BitBtn1Click(Sender: TObject);
- procedure BitBtn2Click(Sender: TObject);
- procedure Edit4Exit(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- procedure ListBox1DblClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- CCICInfoDlg: TCCICInfoDlg;
- const
- LBClickVector : Integer = 0;
- ActiveMailbox : Integer = 0;
-
- implementation
-
- uses CCICCFrm, CCICCPOP;
-
- {$R *.DFM}
- procedure TCCICInfoDlg.Button1Click(Sender: TObject);
- var TempSocket : TCCSocket; { Used for IP Address info }
- DataBuffer : array[ 0 .. 256 ] of char;
- begin
- case Tag of
- 1 : begin { Get IP Address Mode }
- { Create the dummy socket }
- TempSocket := TCCSocket.Create( Self );
- TempSocket.Parent := Self;
- { Use it to get the info }
- with TempSocket do
- begin
- { Move the IP address into the data buffer }
- StrPCopy( DataBuffer , Edit1.Text );
- { Turn it into a real IP address in binary form }
- Socket_IP_Address.Socket_Address.Full_Internet_Address :=
- inet_addr( DataBuffer );
- { If not found then do remote lookup }
- if Socket_IP_Address.Socket_Address.Full_Internet_Address = INADDR_NONE then
- begin
- { Call blocking function on IP name }
- Socket_Host_Entry := gethostbyname( DataBuffer );
- { If still no good then error out and exit }
- if Socket_Host_Entry = nil then
- begin
- Edit2.Text := 'Could Not Convert Host Name';
- Edit3.Text := '';
- end
- else
- begin
- { Otherwise get the address }
- Socket_IP_Address.Socket_Address :=
- Socket_Host_Entry^.Host_Address^^;
- Edit2.Text :=
- IntToStr( Socket_IP_Address.Socket_Address.Net_Byte ) + '.' +
- IntToStr( Socket_IP_Address.Socket_Address.Host_Byte ) + '.' +
- IntToStr( Socket_IP_Address.Socket_Address.Local_Host_Byte ) +
- '.' + IntToStr(
- Socket_IP_Address.Socket_Address.Local_Machine_Byte );
- Edit3.Text :=
- IntToStr( Socket_IP_Address.Socket_Address.
- Full_Internet_Address );
- end;
- end;
- end;
- { Free the dummy socket }
- TempSocket.Free;
- end;
- 2 : begin { Anonymous login punch }
- Edit3.Text := 'anonymous';
- CurrentRealPWString := CurrentPassWordString;
- case PasswordControlVector of
- 1 : Edit4.Text := CurrentPassWordString;
- 2 : Edit4.Text := '**********';
- end;
- end;
- 5 : begin { Toggle subscribe/unsubscribe status }
- if Edit3.Text = 'Subscribed' then Edit3.Text := 'UnSubscribed' else
- Edit3.Text := 'Subscribed';
- end;
- 7 : begin { Set LBClickVector to 1 to allow clicking to move msg }
- LBClickVector := 1;
- ActiveMailBox := ListBox2.ItemIndex;
- end;
- end;
- end;
-
- procedure TCCICInfoDlg.ListBox2Click(Sender: TObject);
- var TheWorkingList : TList;
- Counter_1 : Integer;
- WorkingMBRecord : PEMailMailboxRecord;
- Finished : Boolean;
- begin
- { Use Tag vector to find out how to interpret a click }
- case Tag of
- 2 : begin
- { If nothing in list box then exit }
- if ListBox2.ItemIndex = -1 then exit;
- { Use the data in the Working FTP Site List TList }
- with PConnectionsRecord(
- TheWorkingFTPSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := CProfile;
- Edit2.Text := CIPAddress;
- Edit3.Text := CUserName;
- CurrentRealPWString := CPassword;
- case PasswordControlVector of
- 1 : Edit4.Text := CPassword;
- 2 : Edit4.Text := '**********';
- end;
- Edit5.Text := CStartDir;
- end;
- end;
- 4 : begin
- { If nothing in list box then exit }
- if ListBox2.ItemIndex = -1 then exit;
- { Use the data in the Working FTP Site List TList }
- with PConnectionsRecord(
- TheWorkingNSSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := CProfile;
- Edit2.Text := CIPAddress;
- end;
- end;
- 5 : begin
- { If nothing in list box then exit }
- if ListBox2.ItemIndex = -1 then exit;
- { Use the data in the Working FTP Site List TList }
- with PNewsGroupRecord(
- TheWorkingNRCSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := GName;
- Edit2.Text := GRealName;
- if GSubScribed then Edit3.Text := 'Subscribed' else
- Edit3.Text := 'UnSubscribed';
- end;
- end;
- 6 : begin
- { If nothing in list box then exit }
- if ListBox2.ItemIndex = -1 then exit;
- { Use the data in the Working POPSMTP Site List TList }
- with PConnectionsRecord(
- TheWorkingEMSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := CProfile;
- Edit2.Text := CIPAddress;
- Edit3.Text := CUserName;
- CurrentEMRealPWString := CPassword;
- case EMPasswordControlVector of
- 1 : Edit4.Text := CPassword;
- 2 : Edit4.Text := '**********';
- end;
- Edit5.Text := CStartDir;
- end;
- end;
- 7 : begin
- case LBClickVector of
- 0 : begin
- { If nothing in list box then exit }
- if ListBox2.ItemIndex = -1 then exit;
- ActiveMailBox := ListBox2.ItemIndex;
- { Use the data in the Working FTP Site List TList }
- with PEMailMailboxRecord(
- TheWorkingMBSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := MBName;
- ListBox1.Clear;
- TheWorkingList := TList( MBLTag );
- if TheWorkingList.Count > 0 then
- begin
- for Counter_1 := 0 to TheWorkingList.Count - 1 do
- begin
- ListBox1.Items.Add( PEMailMessageRecord(
- TheWorkingList.Items[ Counter_1 ] )^.MRMessageSubject );
- end;
- Listbox1.ItemIndex := 0;
- end;
- end;
- end;
- 1 : begin
- { If nothing in list box then exit }
- if ListBox2.ItemIndex = -1 then exit;
- WorkingMBRecord := PEMailMailboxRecord(
- TheWorkingMBSL.Items[ ActiveMailbox ] );
- TheWorkingList := TList( WorkingMBRecord^.MBLTag );
- for Counter_1 := 0 to ListBox1.Items.Count - 1 do
- begin
- if ListBox1.Selected[ Counter_1 ] then
- begin
- ThePOP3SMTPComponent.TransferMessage(
- PEMailMailboxRecord( TheWorkingMBSL.Items[ ActiveMailBox ] ) ,
- PEMailMailboxRecord( TheWorkingMBSL.Items[ ListBox2.ItemIndex ] ) ,
- Counter_1 );
- PEMailMessageRecord( TheWorkingList.Items[ Counter_1 ] )^.
- MRMailBoxName := 'Delete Me!';
- end;
- end;
- Counter_1 := 0;
- Finished := false;
- while not Finished do
- begin
- if Counter_1 < TheWorkingList.Count then
- begin
- if PEMailMessageRecord( TheWorkingList.Items[ Counter_1 ] )^.
- MRMailBoxName = 'Delete Me!' then
- begin
- TheWorkingList.Delete( Counter_1 );
- end
- else
- begin
- Inc( Counter_1 );
- if Counter_1 >= TheWorkingList.Count then Finished := true;
- end;
- end
- else finished := true;
- end;
- WorkingMBRecord^.MBLTag := Longint( TheWorkingList );
- ListBox2.ItemIndex := ActiveMailbox;
- LBClickVector := 0;
- ListBox1.Clear;
- for Counter_1 := 0 to TheWorkingList.Count - 1 do
- begin
- ListBox1.Items.Add( PEMailMessageRecord(
- TheWorkingList.Items[ Counter_1 ] )^.MRMessageSubject );
- end;
- Listbox1.ItemIndex := 0;
- end;
- end;
- end;
- 8 : begin
- { If nothing in list box then exit }
- if ListBox2.ItemIndex = -1 then exit;
- { Use the data in the Working FTP Site List TList }
- with PConnectionsRecord(
- TheWorkingCPSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := CProfile;
- Edit2.Text := CIPAddress;
- end;
- end;
- end;
- end;
-
- { This procedure saves the newly modified list of stuff to its base }
- procedure TCCICInfoDlg.BitBtn1Click(Sender: TObject);
- var Counter_1 : Integer; { Loop counter }
- ThePointer : PConnectionsRecord; { Generic TCR Pointer }
- TheNGRecord : PNewsGroupRecord;
- TheMBRecord : PEMailMailboxRecord;
- begin
- { Use the tag vector to find out what to do }
- case Tag of
- 2 : begin { Do FTP Site List }
- { dispose the old FTP site list's pointers }
- for Counter_1 := 0 to TheFTPSiteList.Count - 1 do
- begin
- Dispose( PConnectionsRecord( TheFTPSiteList.Items[ Counter_1 ] ));
- end;
- { Clear the lists }
- TheFTPSiteList.Clear;
- CCInetCCForm.ComboBox1.Clear;
- { Add the new info }
- for Counter_1 := 0 to TheWorkingFTPSL.Count - 1 do
- begin
- { Create a new pointer }
- New( ThePointer );
- { Move the data into it }
- ThePointer^ :=
- PConnectionsRecord( TheWorkingFTPSL.Items[ Counter_1 ] )^;
- { Add the item }
- TheFTPSiteList.Add( ThePointer );
- CCINetCCForm.ComboBox1.Items.Add( PConnectionsRecord(
- TheFTPSiteList.Items[ Counter_1 ] )^.CProfile );
- end;
- CCINetCCForm.ComboBox1.ItemIndex := 0;
- end;
- 4 : begin { Do NNTP Site List }
- { dispose the old FTP site list's pointers }
- for Counter_1 := 0 to TheNewsServerList.Count - 1 do
- begin
- Dispose( PConnectionsRecord( TheNewsServerList.Items[ Counter_1 ] ));
- end;
- { Clear the lists }
- TheNewsServerList.Clear;
- CCInetCCForm.ComboBox1.Clear;
- { Add the new info }
- for Counter_1 := 0 to TheWorkingNSSL.Count - 1 do
- begin
- { Create a new pointer }
- New( ThePointer );
- { Move the data into it }
- ThePointer^ :=
- PConnectionsRecord( TheWorkingNSSL.Items[ Counter_1 ] )^;
- { Add the item }
- TheNewsServerList.Add( ThePointer );
- CCINetCCForm.ComboBox1.Items.Add( PConnectionsRecord(
- TheNewsServerList.Items[ Counter_1 ] )^.CProfile );
- end;
- CCINetCCForm.ComboBox1.ItemIndex := 0;
- end;
- 5 : begin { Do NNTP Newsgroups List }
- { dispose the old NG list's pointers }
- for Counter_1 := 0 to TheNewsRCList.Count - 1 do
- begin
- Dispose( PNewsGroupRecord( TheNewsRCList.Items[ Counter_1 ] ));
- end;
- { Clear the lists }
- TheNewsRCList.Clear;
- { Add the new info }
- for Counter_1 := 0 to TheWorkingNRCSL.Count - 1 do
- begin
- { Create a new pointer }
- New( TheNGRecord );
- { Move the data into it }
- TheNGRecord^ :=
- PNewsGroupRecord( TheWorkingNRCSL.Items[ Counter_1 ] )^;
- { Add the item }
- TheNewsRCList.Add( TheNGRecord );
- end;
- end;
- 6 : begin { Do EMail Server List }
- { dispose the old server list's pointers }
- for Counter_1 := 0 to TheEMailServerList.Count - 1 do
- begin
- Dispose( PConnectionsRecord( TheEMailServerList.Items[ Counter_1 ] ));
- end;
- { Clear the lists }
- TheEMailServerList.Clear;
- CCInetCCForm.ComboBox1.Clear;
- { Add the new info }
- for Counter_1 := 0 to TheWorkingEMSL.Count - 1 do
- begin
- { Create a new pointer }
- New( ThePointer );
- { Move the data into it }
- ThePointer^ :=
- PConnectionsRecord( TheWorkingEMSL.Items[ Counter_1 ] )^;
- { Add the item }
- TheEMailServerList.Add( ThePointer );
- CCINetCCForm.ComboBox1.Items.Add( PConnectionsRecord(
- TheEMailServerList.Items[ Counter_1 ] )^.CProfile );
- end;
- CCINetCCForm.ComboBox1.ItemIndex := 0;
- end;
- 7 : begin { Do Email mailboxes List }
- { dispose the old NG list's pointers }
- for Counter_1 := 0 to TheEMailMailboxList.Count - 1 do
- begin
- Dispose( PEMailMailboxRecord( TheEMailMailboxList.Items[ Counter_1 ] ));
- end;
- { Clear the lists }
- TheEMailMailboxList.Clear;
- { Add the new info }
- for Counter_1 := 0 to TheWorkingMBSL.Count - 1 do
- begin
- { Create a new pointer }
- New( TheMBRecord );
- { Move the data into it }
- TheMBRecord^ :=
- PEMailMailboxRecord( TheWorkingMBSL.Items[ Counter_1 ] )^;
- { Add the item }
- TheEMailMailboxList.Add( TheMBRecord );
- end;
- end;
- 8 : begin { Do EMail Correspondents List }
- { dispose the old correspondents list's pointers }
- for Counter_1 := 0 to TheCorrespondentsList.Count - 1 do
- begin
- Dispose( PConnectionsRecord( TheCorrespondentsList.Items[ Counter_1 ] ));
- end;
- { Clear the lists }
- TheCorrespondentsList.Clear;
- CCInetCCForm.ComboBox2.Clear;
- CCInetCCForm.ComboBox3.Clear;
- { Add the new info }
- for Counter_1 := 0 to TheWorkingCPSL.Count - 1 do
- begin
- { Create a new pointer }
- New( ThePointer );
- { Move the data into it }
- ThePointer^ :=
- PConnectionsRecord( TheWorkingCPSL.Items[ Counter_1 ] )^;
- { Add the item }
- TheCorrespondentsList.Add( ThePointer );
- CCINetCCForm.ComboBox2.Items.Add( PConnectionsRecord(
- TheCorrespondentsList.Items[ Counter_1 ] )^.CProfile );
- CCINetCCForm.ComboBox3.Items.Add( PConnectionsRecord(
- TheCorrespondentsList.Items[ Counter_1 ] )^.CProfile );
- end;
- CCINetCCForm.ComboBox2.ItemIndex := 0;
- CCINetCCForm.ComboBox3.ItemIndex := 0;
- end;
- end;
- { Leave }
- Close;
- end;
-
- { This method cancels any changes made from entries in current setup & exits}
- procedure TCCICInfoDlg.BitBtn2Click(Sender: TObject);
- var Counter_1 : Integer; { Loop counter }
- ThePointer : PConnectionsRecord; { Generic TCR Pointer }
- TheNGRecord : PNewsGroupRecord;
- TheEMMRecord : PEMailMailboxRecord;
- begin
- { Use Tag vector do decide what to reset }
- case Tag of
- 2 : begin { Reset FTP Site list }
- { Dispose of all the old pointers }
- for Counter_1 := 0 to TheWorkingFTPSL.Count - 1 do
- begin
- Dispose( PConnectionsRecord( TheWorkingFTPSL.Items[ Counter_1 ] ));
- end;
- { Clear the working list }
- TheWorkingFTPSL.Clear;
- { Clear the listbox }
- ListBox2.Clear;
- { Then rebuild the working list and display listbox }
- for Counter_1 := 0 to TheFTPSiteList.Count - 1 do
- begin
- { Create the record }
- New( ThePointer );
- { Move data in }
- ThePointer^ :=
- PConnectionsRecord( TheFTPSiteList.Items[ Counter_1 ] )^;
- { Add the pointer to the list }
- TheWorkingFTPSL.Add( ThePointer );
- { Add the profile name to the list }
- ListBox2.Items.Add( PConnectionsRecord(
- TheFTPSiteList.Items[ Counter_1 ] )^.CProfile );
- end;
- end;
- 4 : begin { Reset NNTP Site list }
- { Dispose of all the old pointers }
- for Counter_1 := 0 to TheWorkingNSSL.Count - 1 do
- begin
- Dispose( PConnectionsRecord( TheWorkingNSSL.Items[ Counter_1 ] ));
- end;
- { Clear the working list }
- TheWorkingNSSL.Clear;
- { Clear the listbox }
- ListBox2.Clear;
- { Then rebuild the working list and display listbox }
- for Counter_1 := 0 to TheNewsServerList.Count - 1 do
- begin
- { Create the record }
- New( ThePointer );
- { Move data in }
- ThePointer^ :=
- PConnectionsRecord( TheNewsServerList.Items[ Counter_1 ] )^;
- { Add the pointer to the list }
- TheWorkingNSSL.Add( ThePointer );
- { Add the profile name to the list }
- ListBox2.Items.Add( PConnectionsRecord(
- TheNewsServerList.Items[ Counter_1 ] )^.CProfile );
- end;
- end;
- 5 : begin { Reset NNTP NG list }
- { Dispose of all the old pointers }
- for Counter_1 := 0 to TheWorkingNRCSL.Count - 1 do
- begin
- Dispose( PNewsGroupRecord( TheWorkingNRCSL.Items[ Counter_1 ] ));
- end;
- { Clear the working list }
- TheWorkingNRCSL.Clear;
- { Clear the listbox }
- ListBox2.Clear;
- { Then rebuild the working list and display listbox }
- for Counter_1 := 0 to TheNewsRCList.Count - 1 do
- begin
- { Create the record }
- New( TheNGRecord );
- { Move data in }
- TheNGRecord^ :=
- PNewsGroupRecord( TheNewsRCList.Items[ Counter_1 ] )^;
- { Add the pointer to the list }
- TheWorkingNRCSL.Add( TheNGRecord );
- { Add the profile name to the list }
- ListBox2.Items.Add( PNewsGroupRecord(
- TheNewsRCList.Items[ Counter_1 ] )^.GName );
- end;
- end;
- 6 : begin { Reset FTP Site list }
- { Dispose of all the old pointers }
- for Counter_1 := 0 to TheWorkingEMSL.Count - 1 do
- begin
- Dispose( PConnectionsRecord( TheWorkingEMSL.Items[ Counter_1 ] ));
- end;
- { Clear the working list }
- TheWorkingEMSL.Clear;
- { Clear the listbox }
- ListBox2.Clear;
- { Then rebuild the working list and display listbox }
- for Counter_1 := 0 to TheEMailServerList.Count - 1 do
- begin
- { Create the record }
- New( ThePointer );
- { Move data in }
- ThePointer^ :=
- PConnectionsRecord( TheEMailServerList.Items[ Counter_1 ] )^;
- { Add the pointer to the list }
- TheWorkingEMSL.Add( ThePointer );
- { Add the profile name to the list }
- ListBox2.Items.Add( PConnectionsRecord(
- TheEMailServerList.Items[ Counter_1 ] )^.CProfile );
- end;
- end;
- 7 : begin { Reset NNTP NG list }
- { Dispose of all the old pointers }
- for Counter_1 := 0 to TheWorkingMBSL.Count - 1 do
- begin
- Dispose( PEMailMailboxRecord( TheWorkingMBSL.Items[ Counter_1 ] ));
- end;
- { Clear the working list }
- TheWorkingMBSL.Clear;
- { Clear the listbox }
- ListBox2.Clear;
- { Then rebuild the working list and display listbox }
- for Counter_1 := 0 to TheEMailMailboxList.Count - 1 do
- begin
- { Create the record }
- New( TheEMMRecord );
- { Move data in }
- TheEMMRecord^ :=
- PEMailMailboxRecord( TheEMailMailboxList.Items[ Counter_1 ] )^;
- { Add the pointer to the list }
- TheWorkingMBSL.Add( TheEMMRecord );
- { Add the profile name to the list }
- ListBox2.Items.Add( PEMailMailboxRecord(
- TheEMailMailboxList.Items[ Counter_1 ] )^.MBName );
- end;
- end;
- 8 : begin { Reset FTP Site list }
- { Dispose of all the old pointers }
- for Counter_1 := 0 to TheWorkingCPSL.Count - 1 do
- begin
- Dispose( PConnectionsRecord( TheWorkingCPSL.Items[ Counter_1 ] ));
- end;
- { Clear the working list }
- TheWorkingCPSL.Clear;
- { Clear the listbox }
- ListBox2.Clear;
- { Then rebuild the working list and display listbox }
- for Counter_1 := 0 to TheCorrespondentsList.Count - 1 do
- begin
- { Create the record }
- New( ThePointer );
- { Move data in }
- ThePointer^ :=
- PConnectionsRecord( TheCorrespondentsList.Items[ Counter_1 ] )^;
- { Add the pointer to the list }
- TheWorkingCPSL.Add( ThePointer );
- { Add the profile name to the list }
- ListBox2.Items.Add( PConnectionsRecord(
- TheCorrespondentsList.Items[ Counter_1 ] )^.CProfile );
- end;
- end;
- end;
- { Leave }
- Close;
- end;
-
- procedure TCCICInfoDlg.Edit4Exit(Sender: TObject);
- begin
- { Use tag vector to determine action }
- case Tag of
- 2 : begin
- { If Edit4 is modified then mangle pw }
- if Edit4.Modified then
- begin
- { Save pw in either case, but mangle if masked }
- case PasswordControlVector of
- 1 : CurrentRealPWString := Edit4.Text;
- 2 : begin
- CurrentRealPWString := Edit4.Text;
- Edit4.Text := '***********';
- end;
- end;
- end;
- end;
- 6 : begin
- { If Edit4 is modified then mangle pw }
- if Edit4.Modified then
- begin
- { Save pw in either case, but mangle if masked }
- case EMPasswordControlVector of
- 1 : CurrentEMRealPWString := Edit4.Text;
- 2 : begin
- CurrentEMRealPWString := Edit4.Text;
- Edit4.Text := '***********';
- end;
- end;
- end;
- end;
- end;
- end;
-
- { Add button; do various add actions }
- procedure TCCICInfoDlg.Button2Click(Sender: TObject);
- var ThePointer : PConnectionsRecord; { PCR Pointer }
- TheNGRecord : PNewsGroupRecord;
- TheEMBRecord : PEMailMailboxRecord;
- TempList : TList;
- begin
- { Tag vector control as usual }
- case Tag of
- 2 : begin { add new FTP site list entry }
- { Creat new PCR pointer }
- New( ThePointer );
- { Add in the data from the text fields }
- with ThePointer^ do
- begin
- CProfile := Edit1.Text;
- CIPAddress := Edit2.Text;;
- CUserName := Edit3.Text;
- { Put in the real pw string }
- CPassword := CurrentRealPWString;
- CStartDir := Edit5.Text;
- end;
- { Add pointer to working list }
- TheWorkingFTPSL.Add( ThePointer );
- { Add it to the listbox }
- ListBox2.Items.Add( ThePointer^.CProfile );
- { And set the pointer to it }
- ListBox2.ItemIndex := ListBox2.Items.Count - 1;
- end;
- 4 : begin { add new NNTP site list entry }
- { Creat new PCR pointer }
- New( ThePointer );
- { Add in the data from the text fields }
- with ThePointer^ do
- begin
- CProfile := Edit1.Text;
- CIPAddress := Edit2.Text;;
- CUserName := '';
- CPassword := '';
- CStartDir := '';
- end;
- { Add pointer to working list }
- TheWorkingNSSL.Add( ThePointer );
- { Add it to the listbox }
- ListBox2.Items.Add( ThePointer^.CProfile );
- { And set the pointer to it }
- ListBox2.ItemIndex := ListBox2.Items.Count - 1;
- end;
- 5 : begin { add new NNTP newsgroup list entry }
- { Creat new PCR pointer }
- New( TheNGRecord );
- TempList := TList.Create;
- { Add in the data from the text fields }
- with TheNGRecord^ do
- begin
- GName := Edit1.Text;
- GRealName := Edit2.Text;;
- if Edit3.Text = 'UnSubscribed' then GSubscribed := false else
- GSubScribed := true;
- GLowest := 0;
- GHighest := 0;
- GTotalNew := 0;
- GTotalAvailable := 0;
- GLowestAvailable := 0;
- GHighestAvailable := 0;
- GPostable := true;
- GTotalArticles := 0;
- GTotalUnReadArticles := 0;
- GIDNumber := TheWorkingNRCSL.Count + 1;
- GFileName := 'NL' + IntToStr( WhichServer ) + 'G' +
- IntToStr( GIDNumber) + '.NGR';
- GLTag := Longint( TempList );
- end;
- { Add pointer to working list }
- TheWorkingNRCSL.Add( TheNGRecord );
- { Add it to the listbox }
- ListBox2.Items.Add( TheNGRecord^.GName );
- { And set the pointer to it }
- ListBox2.ItemIndex := ListBox2.Items.Count - 1;
- end;
- 6 : begin { add new EMail server list entry }
- { Creat new PCR pointer }
- New( ThePointer );
- { Add in the data from the text fields }
- with ThePointer^ do
- begin
- CProfile := Edit1.Text;
- CIPAddress := Edit2.Text;;
- CUserName := Edit3.Text;
- { Put in the real pw string }
- CPassword := CurrentEMRealPWString;
- CStartDir := Edit5.Text;
- end;
- { Add pointer to working list }
- TheWorkingEMSL.Add( ThePointer );
- { Add it to the listbox }
- ListBox2.Items.Add( ThePointer^.CProfile );
- { And set the pointer to it }
- ListBox2.ItemIndex := ListBox2.Items.Count - 1;
- end;
- 7 : begin { add new mailbox list entry }
- { Creat new PCR pointer }
- New( TheEMBRecord );
- TempList := TList.Create;
- { Add in the data from the text fields }
- with TheEMBRecord^ do
- begin
- MBName := Edit1.Text;
- MBIDNumber := TheWorkingMBSL.Count + 1;
- MBMaxMsgNumber := 0;
- MBTotal := 0;
- MBUnReadTotal := 0;
- MBUnSentTotal := 0;
- MBMsgFileName := 'MB' + IntToStr( MBIDNumber ) + '.MBX';
- MBLTag := Longint( TempList );
- end;
- { Add pointer to working list }
- TheWorkingMBSL.Add( TheEMBRecord );
- { Add it to the listbox }
- ListBox2.Items.Add( TheEMBRecord^.MBName );
- { And set the pointer to it }
- ListBox2.ItemIndex := ListBox2.Items.Count - 1;
- ListBox2Click( Self );
- end;
- 8 : begin { add new correspondents list entry }
- { Creat new PCR pointer }
- New( ThePointer );
- { Add in the data from the text fields }
- with ThePointer^ do
- begin
- CProfile := Edit1.Text;
- CIPAddress := Edit2.Text;
- end;
- { Add pointer to working list }
- TheWorkingCPSL.Add( ThePointer );
- { Add it to the listbox }
- ListBox2.Items.Add( ThePointer^.CProfile );
- { And set the pointer to it }
- ListBox2.ItemIndex := ListBox2.Items.Count - 1;
- end;
- end;
- end;
-
- { This is the modify button }
- procedure TCCICInfoDlg.Button3Click(Sender: TObject);
- begin
- { Use Tag vector as usual }
- case Tag of
- 2 : begin
- { if nothing to modify the exit }
- if ListBox2.ItemIndex = -1 then exit;
- { get record of current listbox pointer & put in data }
- with PConnectionsRecord(
- TheWorkingFTPSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- CProfile := Edit1.Text;
- CIPAddress := Edit2.Text;;
- CUserName := Edit3.Text;
- { Put in the real pw string }
- CPassword := CurrentRealPWString;
- CStartDir := Edit5.Text;
- end;
- { Make sure the display matches the edit control }
- ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
- end;
- 4 : begin
- { if nothing to modify the exit }
- if ListBox2.ItemIndex = -1 then exit;
- { get record of current listbox pointer & put in data }
- with PConnectionsRecord(
- TheWorkingNSSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- CProfile := Edit1.Text;
- CIPAddress := Edit2.Text;
- CUserName := '';
- CPassword := '';
- CStartDir := '';
- end;
- { Make sure the display matches the edit control }
- ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
- end;
- 5 : begin
- { if nothing to modify the exit }
- if ListBox2.ItemIndex = -1 then exit;
- { get record of current listbox pointer & put in data }
- with PNewsGroupRecord(
- TheWorkingNRCSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- GName := Edit1.Text;
- GRealName := Edit2.Text;;
- if Edit3.Text = 'UnSubscribed' then GSubscribed := false else
- GSubScribed := true;
- end;
- { Make sure the display matches the edit control }
- ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
- end;
- 6 : begin
- { if nothing to modify the exit }
- if ListBox2.ItemIndex = -1 then exit;
- { get record of current listbox pointer & put in data }
- with PConnectionsRecord(
- TheWorkingEMSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- CProfile := Edit1.Text;
- CIPAddress := Edit2.Text;;
- CUserName := Edit3.Text;
- { Put in the real pw string }
- CPassword := CurrentEMRealPWString;
- CStartDir := Edit5.Text;
- end;
- { Make sure the display matches the edit control }
- ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
- end;
- 7 : begin
- { if nothing to modify the exit }
- if ListBox2.ItemIndex = -1 then exit;
- { get record of current listbox pointer & put in data }
- with PEMailMailboxRecord(
- TheWorkingMBSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- MBName := Edit1.Text;
- end;
- { Make sure the display matches the edit control }
- ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
- ListBox2Click( Self );
- end;
- 8 : begin
- { if nothing to modify the exit }
- if ListBox2.ItemIndex = -1 then exit;
- { get record of current listbox pointer & put in data }
- with PConnectionsRecord(
- TheWorkingCPSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- CProfile := Edit1.Text;
- CIPAddress := Edit2.Text;;
- end;
- { Make sure the display matches the edit control }
- ListBox2.Items[ ListBox2.ItemIndex ] := Edit1.Text;
- end;
- end;
- end;
-
- { This is the delete button }
- procedure TCCICInfoDlg.Button4Click(Sender: TObject);
- var MessageString : String; { String holder }
- begin
- { Use tag control vector }
- case Tag of
- 2 : begin
- { If nothing to delete then leave }
- if Listbox2.Itemindex = -1 then exit;
- { Set up display }
- MessageString := 'Delete Entry ' + Edit1.Text + '?';
- { Display message box and get result }
- if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
- = mrYes then
- begin
- { if ok delete then remove item from working sl }
- TheWorkingFTPSL.Delete( ListBox2.ItemIndex );
- { delete from listbox }
- ListBox2.Items.Delete( ListBox2.ItemIndex );
- { If nothing left set itemindex and clear edits }
- if ListBox2.Items.Count = 0 then
- begin
- ListBox2.ItemIndex := -1;
- Edit1.Text := '';
- Edit2.Text := '';
- Edit3.Text := '';
- Edit4.Text := '';
- Edit5.Text := '';
- end
- else
- begin
- { Reset listbox pointer }
- ListBox2.ItemIndex := 0;
- { and reset display to new item }
- with PConnectionsRecord(
- TheWorkingFTPSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := CProfile;
- Edit2.Text := CIPAddress;
- Edit3.Text := CUserName;
- CurrentRealPWString := CPassword;
- case PasswordControlVector of
- 1 : Edit4.Text := CPassword;
- 2 : Edit4.Text := '**********';
- end;
- Edit5.Text := CStartDir;
- end;
- end;
- end;
- end;
- 4 : begin
- { If nothing to delete then leave }
- if Listbox2.Itemindex = -1 then exit;
- { Set up display }
- MessageString := 'Delete Entry ' + Edit1.Text + '?';
- { Display message box and get result }
- if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
- = mrYes then
- begin
- { if ok delete then remove item from working sl }
- TheWorkingNSSL.Delete( ListBox2.ItemIndex );
- { delete from listbox }
- ListBox2.Items.Delete( ListBox2.ItemIndex );
- { If nothing left set itemindex and clear edits }
- if ListBox2.Items.Count = 0 then
- begin
- ListBox2.ItemIndex := -1;
- Edit1.Text := '';
- Edit2.Text := '';
- Edit3.Text := '';
- Edit4.Text := '';
- Edit5.Text := '';
- end
- else
- begin
- { Reset listbox pointer }
- ListBox2.ItemIndex := 0;
- { and reset display to new item }
- with PConnectionsRecord(
- TheWorkingNSSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := CProfile;
- Edit2.Text := CIPAddress;
- end;
- end;
- end;
- end;
- 5 : begin
- { If nothing to delete then leave }
- if Listbox2.Itemindex = -1 then exit;
- { Set up display }
- MessageString := 'Delete Entry ' + Edit1.Text + '?';
- { Display message box and get result }
- if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
- = mrYes then
- begin
- { if ok delete then remove item from working sl }
- TheWorkingNRCSL.Delete( ListBox2.ItemIndex );
- { delete from listbox }
- ListBox2.Items.Delete( ListBox2.ItemIndex );
- { If nothing left set itemindex and clear edits }
- if ListBox2.Items.Count = 0 then
- begin
- ListBox2.ItemIndex := -1;
- Edit1.Text := '';
- Edit2.Text := '';
- Edit3.Text := '';
- Edit4.Text := '';
- Edit5.Text := '';
- end
- else
- begin
- { Reset listbox pointer }
- ListBox2.ItemIndex := 0;
- { and reset display to new item }
- with PNewsGroupRecord(
- TheWorkingNRCSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := GName;
- Edit2.Text := GRealName;
- if not GSubscribed then Edit3.Text := 'UnSubscribed' else
- Edit3.Text := 'SubScribed';
- end;
- end;
- end;
- end;
- 6 : begin
- { If nothing to delete then leave }
- if Listbox2.Itemindex = -1 then exit;
- { Set up display }
- MessageString := 'Delete Entry ' + Edit1.Text + '?';
- { Display message box and get result }
- if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
- = mrYes then
- begin
- { if ok delete then remove item from working sl }
- TheWorkingEMSL.Delete( ListBox2.ItemIndex );
- { delete from listbox }
- ListBox2.Items.Delete( ListBox2.ItemIndex );
- { If nothing left set itemindex and clear edits }
- if ListBox2.Items.Count = 0 then
- begin
- ListBox2.ItemIndex := -1;
- Edit1.Text := '';
- Edit2.Text := '';
- Edit3.Text := '';
- Edit4.Text := '';
- Edit5.Text := '';
- end
- else
- begin
- { Reset listbox pointer }
- ListBox2.ItemIndex := 0;
- { and reset display to new item }
- with PConnectionsRecord(
- TheWorkingEMSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := CProfile;
- Edit2.Text := CIPAddress;
- Edit3.Text := CUserName;
- CurrentEMRealPWString := CPassword;
- case EMPasswordControlVector of
- 1 : Edit4.Text := CPassword;
- 2 : Edit4.Text := '**********';
- end;
- Edit5.Text := CStartDir;
- end;
- end;
- end;
- end;
- 7 : begin
- { If nothing to delete then leave }
- if Listbox2.Itemindex = -1 then exit;
- { Set up display }
- MessageString := 'Delete Entry ' + Edit1.Text + '?';
- { Display message box and get result }
- if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
- = mrYes then
- begin
- { if ok delete then remove item from working sl }
- TheWorkingMBSL.Delete( ListBox2.ItemIndex );
- { delete from listbox }
- ListBox2.Items.Delete( ListBox2.ItemIndex );
- { If nothing left set itemindex and clear edits }
- if ListBox2.Items.Count = 0 then
- begin
- ListBox2.ItemIndex := -1;
- Edit1.Text := '';
- Edit2.Text := '';
- Edit3.Text := '';
- Edit4.Text := '';
- Edit5.Text := '';
- end
- else
- begin
- { Reset listbox pointer }
- ListBox2.ItemIndex := 0;
- { and reset display to new item }
- with PEmailmailboxRecord(
- TheWorkingMBSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := MBName;
- end;
- end;
- end;
- end;
- 8 : begin
- { If nothing to delete then leave }
- if Listbox2.Itemindex = -1 then exit;
- { Set up display }
- MessageString := 'Delete Entry ' + Edit1.Text + '?';
- { Display message box and get result }
- if MessageDlg( MessageString , mtConfirmation , mbYesNoCancel , 0 )
- = mrYes then
- begin
- { if ok delete then remove item from working sl }
- TheWorkingCPSL.Delete( ListBox2.ItemIndex );
- { delete from listbox }
- ListBox2.Items.Delete( ListBox2.ItemIndex );
- { If nothing left set itemindex and clear edits }
- if ListBox2.Items.Count = 0 then
- begin
- ListBox2.ItemIndex := -1;
- Edit1.Text := '';
- Edit2.Text := '';
- Edit3.Text := '';
- Edit4.Text := '';
- Edit5.Text := '';
- end
- else
- begin
- { Reset listbox pointer }
- ListBox2.ItemIndex := 0;
- { and reset display to new item }
- with PConnectionsRecord(
- TheWorkingCPSL.Items[ ListBox2.ItemIndex ] )^ do
- begin
- Edit1.Text := CProfile;
- Edit2.Text := CIPAddress;
- end;
- end;
- end;
- end;
- end;
- end;
-
- procedure TCCICInfoDlg.ListBox1DblClick(Sender: TObject);
- begin
- case Tag of
- 5 : begin
- if ListBox1.ItemIndex <> -1 then
- Edit2.Text := ListBox1.Items[ Listbox1.ItemIndex ];
- end;
- end;
- end;
-
- end.
-